<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
          var str = `<span>9.7</span><span>-248人评价</span><br>
        <span>9.5</span><span>-48人评价</span><br>
        <span>9.6</span><span>-508人评价</span>`
        var arr = str.split("<br>");
        var reg = /<[^<>]+>/g;
        var res = arr.map(item=>{
            var list = item.replace(reg,"").trim().split("-");
            return list;
        })
        var sum = []
        res.forEach(k=>{
          
                sum.push({
                star:k[0],
                rating:k[1]
            })
            
           
        })
        console.log(sum)
    </script>
</body>
</html>